package com.itheima.reggie.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.reggie.common.Result;
import com.itheima.reggie.entity.AddressBook;

import java.util.List;

/**
 * @author Yan
 */
public interface AddressBookService extends IService<AddressBook> {
    /**
     * 新增
     * @param addressBook
     * @return
     */
    Result<AddressBook> saveAddressBook(AddressBook addressBook);

    /**
     * 设置默认地址
     * @param addressBook
     * @return
     */
    Result<AddressBook> setDefault(AddressBook addressBook);

    /**
     * 根据id查询地址
     * @param id
     * @return
     */
    Result<AddressBook> findAddressBookById(Long id);

    /**
     * 查询默认地址
     * @return
     */
    Result<AddressBook> getDefault();

    /**
     * 查询当前用户得所有地址
     * @param addressBook
     * @return
     */
    Result<List<AddressBook>> findAddressBookList(AddressBook addressBook);

    /**
     * 修改地址
     * @param addressBook
     * @return
     */
    Result<String> updateAddressBook(AddressBook addressBook);

    /**
     * 删除地址
     * @param ids
     * @return
     */
    Result<String> deleteAddressBook(Long ids);
}